package com.demo2do.fms.admin.service.supplier;

import java.util.Date;
import java.util.List;

import com.demo2do.core.entity.page.Page;
import com.demo2do.fms.admin.entity.search.supplier.AppraisalResultSearch;
import com.demo2do.fms.admin.entity.security.Login;
import com.demo2do.fms.admin.service.DataService;
import com.demo2do.fms.entity.appraisal.Appraisal;
import com.demo2do.fms.entity.appraisal.AppraisalResultItem;
import com.demo2do.fms.entity.appraisal.AppraisalType;
import com.demo2do.fms.entity.appraisal.AppraisalResult;
import com.demo2do.fms.entity.supplier.common.Supplier;
import com.demo2do.fms.entity.vendor.Vendor;

/**
 * 
 * @author houtao
 *
 */
public interface AppraisalResultService extends DataService<AppraisalResult> {
    
    /**
     * @param appraisalId
     * @param operator 
     */
    public void delete(Long appraisalResultId, Long operator);
    
    /**
     * 
     * @param target
     * @return
     */
    public int countByTarget(String target, Login login);
    
    /**
     * 
     * @param targets
     * @return
     */
    public int countByTarget(List<String> targets);
    
    /**
     * @param login
     * @return
     */
    public int count(Login login);

    /**
     * @param search
     * @param login
     * @return
     */
    public int count(AppraisalResultSearch search, Login login);
    
    /**
     * @param search
     * @param login
     * @param page
     * @return
     */
    public List<AppraisalResult> list(AppraisalResultSearch search, Login login, Page page);
    
    /**
     * 
     * @param resultIds
     * @return
     */
    public List<AppraisalResultItem> listByResult(List<Long> resultIds);
    
    /**
     * @param target
     * @return
     */
    public List<AppraisalResult> listByTarget(String target, Login login);
    
    /**
     * @param target
     * @param timeAgo
     * @return
     */
    public List<AppraisalResult> listByTarget(String target, Date timeAgo);
    
    /**
     * 
     * @param target
     * @param page
     * @return
     */
    public List<AppraisalResult> listByTarget(String target, Page page);
    
    /**
     * @param targets
     * @return
     */
    public List<AppraisalResult> listByTarget(List<String> targets);
    
    /**
     * @param login
     * @param page
     * @return
     */
    public List<AppraisalResult> list(Login login, Page page);
    
    /**
     * @param appraisal
     * @return
     */
    public List<AppraisalResult> list(Appraisal appraisal);
    
    /**
     * @param appraisal
     * @return
     */
    public List<String> listTarget(Appraisal appraisal);
    
    /**
     * 
     * @param appraisalId
     * @return
     */
    public List<AppraisalResultItem> listItem(Appraisal appraisal);

    /**
     * 
     * @param appraisalResultId
     * @return
     */
    public List<AppraisalResultItem> listItem(AppraisalResult appraisalResult);

    /**
     * 
     * @param supplier
     * @param appraisal
     */
    public void create(Supplier supplier, Appraisal appraisal, Long operator);
    
    /**
     * 
     * @param vendor
     * @param appraisal
     */
    public void create(Vendor vendor, Appraisal appraisal, Long operator);

    /**
     * 
     * @param itemResults
     * @param appraisalResult
     * @param login
     */
    public void rate(List<String> itemResults, AppraisalResult appraisalResult, Login login);

	/**
	 * @param supplierId
	 * @param timeAgo
	 * @param appraisalType
	 * @return
	 */
	public List<AppraisalResult> listByTarget(String supplierId, Date timeAgo, AppraisalType appraisalType);
    
}
